import java.io.Serializable;
import java.util.Observable;
import java.util.HashMap;

public class Parution extends Observable implements Serializable {
	
	private static final long serialVersionUID = 1L;
	private String _id;
	private Periodique _pe;
	private HashMap<String,Article> _lesArticles;
			
	public Parution(String id, Periodique pe){
		this.setId(id);
		this.setPeriodique(pe);
		pe.setParution(this);
		_lesArticles= new HashMap<String,Article>();
	}
	
	public void setId(String id){
		_id=id;
	}
	
	public String getId(){
		return _id;
	}
	
	public void setPeriodique(Periodique pe){
		_pe=pe;
	}
	
	public HashMap<String,Article> getLesArticles(){
		return _lesArticles;
	}
	public HashMap<String, Article> getArticles(){
		return _lesArticles;
	}
	
	public void setArticle(Article ar){
		this.getArticles().put(ar.getTitre(), ar);
		notifierObservateurs();
	}
	
	public void notifierObservateurs() {
		this.setChanged();
		this.notifyObservers();	
	}
}
